home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / applications / wp / pmtex.lha / pmtex / doc / pmtex.txt
Encoding:
Text File  |  1995-02-28  |  10.8 KB  |  202 lines

  1.                                PMTeX
  2.                     A Preprocessor for MusicTeX
  3.                 by Don Simons (dsimons@logicon.com)
  4.  
  5. INTRODUCTION       
  6.      PMTeX will generate MusicTeX code for multi-staff scores with up to 
  7. five staves (or voices) per system.  Once it makes a .tex file for you, 
  8. you will probably want or need to change a few things manually.  This is 
  9. because (a) PMTeX only has a small subset of the capabilities of 
  10. MusicTeX, and (b) PMTeX is not perfect.  But it can save a LOT of time 
  11. with the grunge work involved in setting up notes...enotes groupings, 
  12. defining beams, justifying lines, and spreading the entire piece evenly 
  13. over a specified number of systems.
  14.      PMTeX can deal with one and only one melody per staff (voice).  It 
  15. won't let you change the time signature or key signature within a piece.  
  16. Except the first bar, every bar in each staff must have exactly the 
  17. number of beats specified by the input parameter mtrnum.  On the first 
  18. pass pmtexa will choke if these timings or just about anything else is 
  19. askew in the input.  The error messages are not especially pointed, so 
  20. it is best to enter only a few bars at a time, run pmtexa, correct 
  21. errors, rerun, etc.
  22.      You can enter note values and rests from whole notes to 32nds, and 
  23. trills and mordents.  Since I'm interested in baroque chamber music, I 
  24. built in the ability to notate figured bass below the bottom staff in 
  25. each system.
  26.  
  27. SETUP
  28.      The distribution contains the files pmtexa.for, pmtexb.for, 
  29. pmtex.inc, sample.inp, and pmtex.tex.  First compile the two FORTRAN 
  30. programs (with the .inc file accessible to the compiler).  I used 
  31. Microsoft FORTRAN to develop the code, and have checked that it works on 
  32. an IBM RISC 6000 when compiled with xlf.  I hope the code is generic 
  33. enough that it will work with other systems.  Put the executables either 
  34. in your working directory or somewhere in the path.  Put pmtex.tex into 
  35. the texinput directory.  Put sample.inp into your working directory (the 
  36. one from which you will run PMTeX.  Edit the 7th line of sample.inp to 
  37. contain the path to the texinput directory; the code will put the .tex 
  38. file there. If you want this to be the same as the working directory, 
  39. type '.\' for DOS, or './' for UNIX (don't type the quotes).  If you 
  40. have a conventional PCTeX setup you would enter 'c:\pctex\texinput\', 
  41. etc.  Next run the first pass by typing 'pmtexa'.  You will be prompted 
  42. for a basename; for the sample it is 'sample'.  If pmtexa runs 
  43. successfully it will generate two files in the working directory, 
  44. pmtex.fig and pmtex.dat.  Next run pmtexb by typing 'pmtexb'.  This will 
  45. put sample.tex and sample.fig into the texinput directory (.fig only if 
  46. you have figured bass).  Now you are right where you would be after 
  47. manually entering, debugging, and rough-editing any .tex file.  To see 
  48. the results, 'tex' the file sample.tex.  You'll notice that two systems 
  49. on each of the two pages are a little too long.  That's not your fault; 
  50. I left things that way just to PROVE that PMTeX isn't perfect.  To fix 
  51. them, manually increase the first autolines parameter for each of these 
  52. lines by one.
  53.  
  54. WHAT GOES INTO AN INPUT FILE
  55.      Let's just go through sample.inp.  It will take a while, but we'll 
  56. cover practically all the possible inputs.  For reference, here are the 
  57. first 9 lines of the file:  
  58.  
  59. 3 3 4 4 6 1 3 
  60. 5 10 20 0.07 
  61. Basso 
  62. Violin II 
  63. Violin I 
  64. btt 
  65. c:\pctex\texinput\
  66. %     read(10,*)nv,noinst,mtrnum,mtrden,imeter,xmtrnum0,isig, 
  67. %    *          lpp,nstaves,musicsize,fracindent       
  68.  
  69. These are the setup data.  The lines with % in column 1 are comments.  
  70. You can only put comments AFTER the end of the initial data section.  
  71. Starting in the first line,   
  72.  
  73. nv (integer<6) is the number of voices, or staves per system.    
  74.  
  75. noinst (integer<6) is number of 'instruments'.  All this does is choose
  76.      whether you want a brace in front of each system (noinst=1) or not
  77.      (noinst>1).    
  78.  
  79. mtrnum is the numerator of the time signature, mtrden the denominator.
  80.      So far I've only tested 3/4, 6/8, 2/2, 2/4, and 4/4 but others may 
  81.      work.  
  82.  
  83. imeter determines how the time signature looks:      
  84.      0           Fraction
  85.      2, 3, or 4  Just that number, between the 2nd and 4th lines
  86.      5           Common time
  87.      6           Cut time (alla breve)
  88.  
  89. xmtrnum0 is the number of beats in the first bar, but only if there's
  90.      a pickup; otherwise set it to 0 .  I had intended fractions to work
  91.      but they don't seem to, just integers.  The first bar is the ONLY
  92.      bar that can have a different number of beats.   
  93.  
  94. isig is the key signature, positive integer for sharps, negative for
  95.      flats.
  96.  
  97. lpp is the number of systems per page.
  98.  
  99. nstaves is a misnomer (I just realized): it's really the total number of
  100.      systems in the whole piece.  Leftovers start at the front, so for
  101.      example if lpp=3 and nstaves=5 there will 3 systems on the first
  102.      page.  WARNING: if you are building an input file one gulp at a 
  103.      time, you will have to adjust this parameter to roughly reflect the 
  104.      CURRENT number of staves.  If nstaves is too big for the current 
  105.      number of bars. the code will choke.
  106.  
  107. musicsize is 20 or 16 (height of a staff in points).
  108.  
  109. fracindent is the fraction of the total line width to indent the first
  110.      line.
  111.  
  112.      Next come the names of the nv instruments as you want them to 
  113. appear within the indentation in the first system, one per line, 
  114. starting with the BOTTOM voice.  Then a string of nv letters for the 
  115. clefs, again starting with the bottom voice: 'b' for bass, 'a' for alto, 
  116. 't' for treble.       
  117.      Line 7 in sample.inp is the last of the setup data, the path to the 
  118. .tex directory, where you want sample.tex to go when pmtex makes it.         
  119. The rest of sample.inp is the body of the input.  You feed it music in 
  120. gulps of an integral number of bars, usually 4 to 8.  If you give it too 
  121. big a gulp, it will choke (due to dimension limits), and there aren't 
  122. any internal dimension checks.  (I've been bitten by this one myself). 
  123. Each gulp has some stuff for a few bars of the first (lowest) voice, 
  124. then a '/', then the second voice for EXACTLY the same number of bars, 
  125. another '/', and so on for nv voices.  When the last (top) voice 
  126. finishes (with a '/') the gulp is ready for digestion.
  127.      The stuff for each voice is a sequence of "symbols" of one or more 
  128. adjacent characters, separated by spaces.  Separate the voice-
  129. terminating '/' with spaces just to be safe.
  130.      Note symbols always start with a letter and end at the first space. 
  131. The letter has the obvious meaning (unlike another entry system we all 
  132. know about, which unfortunately I could never get comfortable with and 
  133. believe me I did try but I guess I'm getting too old).  Next is a digit 
  134. for the octave...middle C is c4, the B just below is b3.  If a note is 
  135. the same length and within a fourth of its predecessor, the symbol can 
  136. be one letter only, provided it doesn't have an accidental.  This makes 
  137. it really easy to enter long strings of scalewise or even arpeggiated 
  138. notes of equal value: letter,space,letter,space...  If a note is the 
  139. same length but more than a fourth away from its predecessor, and again 
  140. no accidental, the note symbol can be just two characters long, the note 
  141. name and the octave.  Next comes a digit for the length (if needed): 0 
  142. for whole, 2 for half, 4 for quarter, 8 for eighth, 1 for sixteenth, and 
  143. 3 for thirty-second notes (with credit to Dr. T's Copyist Apprentice, my 
  144. first foray into notation programs.  Actually it seems really cool to me 
  145. that these digits don't bump into each other but still cover all normal 
  146. possibilities.)  (Sorry, we don't do triplets.  If you just have a few 
  147. triplets, enter something else and fix them by hand later.  If there are 
  148. a lot of triplets you could try using a separate file for that section, 
  149. faking out the code with a different time signature--say 6/8 instead of 
  150. 2/4--then manually merging the .tex files later.)  The next two 
  151. characters (if needed) are letters to signal a dot ('d') and/or 
  152. accidental ('f':flat, 'n':natural, 's':sharp).  If both are present they 
  153. can be in either order.  If either is present then the first three 
  154. characters--note, octave, duration--are required.  Don't enter an 
  155. accidental if it's in the key signature.  Advanced users can change the 
  156. behavior of the accidentals to 'smart' (transposable) from literal (the 
  157. default) by editing pmtex.tex.  (With the baroque convention for 
  158. accidentals, 'smart' ones don't work even if you're not transposing!)  
  159. The code tries to put in extra horizontal space if needed to make room 
  160. for accidentals.
  161.      After a note symbol goes any associated ornament or figure.  The 
  162. only ornaments are trill ('ot') and mordent ('om').  (Minimal 
  163. programming could expand this list, but I haven't needed any others).  
  164. All accidentals will come out just high enough above the staff not to 
  165. crash into their notes.
  166.      A rest symbol has two characters, just 'r' followed by a digit for 
  167. its length, using the same code as for note values.
  168.  
  169. FIGURED BASS
  170.      Figure symbols follow their associated note symbols.  They only 
  171. work in the first (lowest) voice.  Enter the characters as they would 
  172. appear from top to bottom, and as you might pronounce them, e.g., '64' 
  173. or '73'.  Flats here are '-' (minus), sharps are '#', and naturals 'n', 
  174. BEFORE the number (if there is a number) (perversity or absentmindedness 
  175. is why they're different here than in note symbols).  So six (over) flat 
  176. five is  '6-5' as in the first line of the body of sample.inp, and sharp 
  177. six (over) 4 is '#64'.  The program prints all the figures for each 
  178. system below the lowest staff, with their tops aligned, and just low 
  179. enough to clear the lowest beam, notehead, or stem that could interfere.  
  180. (This was kind of tricky to program!)
  181.  
  182. A WORD ABOUT SLURS AND TIES
  183.      There's no provision for them in PMTeX.  Why?  I handle them with 
  184. another code that post-processes the postscript file.  That code will 
  185. only run on a PC with VGA graphics.  If there is interest, I'll 
  186. distribute it later.  But for now, sorry, you're on your own.  At worst, 
  187. you can enter MusicTeX slur codes manually.
  188.  
  189. TH-TH-THAT'S ALL, FOLKS
  190.      There's not much more to say about basic care and feeding of PMTeX.  
  191. One suggestion worth repeating is to enter just a few bars at a time, 
  192. and at least run them through pmtexa to get rid of typos.  If you wanted 
  193. to type a lot at once, you could comment out all gulps but the first, 
  194. then delete comment symbols a gulp at a time, letting PMTeX digest the 
  195. gulps one-by-one.  Unless you never make mistakes.
  196.      Please hit me with questions, bugs, and comments. I'll consider 
  197. suggestions for additions as time and inclination permit.  I am thinking 
  198. about improving the input checking in pmtexa.  There is one thing I hope 
  199. I don't hear: that after trying the program you think my silly 
  200. gastrointestinal metaphor should be carried to its logical "end" when 
  201. describing PMTeX's output.
  202.